home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / ietf / urn / urn-archives / urn-ietf.archive.9701 / 000003_owner-urn-ietf _Thu Jan 9 12:27:57 1997.msg < prev    next >
Internet Message Format  |  1997-02-19  |  18KB

  1. Received: (from daemon@localhost) by services.bunyip.com (8.6.10/8.6.9) id MAA23579 for urn-ietf-out; Thu, 9 Jan 1997 12:27:57 -0500
  2. Received: from mocha.bunyip.com (mocha.Bunyip.Com [192.197.208.1]) by services.bunyip.com (8.6.10/8.6.9) with SMTP id MAA23574 for <urn-ietf@services.bunyip.com>; Thu, 9 Jan 1997 12:27:52 -0500
  3. Received: from acl.lanl.gov by mocha.bunyip.com with SMTP (5.65a/IDA-1.4.2b/CC-Guru-2b)
  4.         id AA03667  (mail destined for urn-ietf@services.bunyip.com); Thu, 9 Jan 97 12:27:18 -0500
  5. Received: from magenta.acl.lanl.gov (magenta.acl.lanl.gov [128.165.147.153]) by acl.lanl.gov (8.7.3/8.7.3) with ESMTP id KAA00789 for <urn-ietf@bunyip.com>; Thu, 9 Jan 1997 10:26:56 -0700 (MST)
  6. From: "Ronald E. Daniel" <rdaniel@acl.lanl.gov>
  7. Received: (rdaniel@localhost) by magenta.acl.lanl.gov (8.7.5/8.6.4) id KAA01201 for urn-ietf@bunyip.com; Thu, 9 Jan 1997 10:26:55 -0700 (MST)
  8. Date: Thu, 9 Jan 1997 10:26:55 -0700 (MST)
  9. Message-Id: <199701091726.KAA01201@magenta.acl.lanl.gov>
  10. To: urn-ietf@bunyip.com
  11. Subject: [URN] http conventions draft version 01
  12. Sender: owner-urn-ietf@services.bunyip.com
  13. Precedence: bulk
  14. Reply-To: "Ronald E. Daniel" <rdaniel@acl.lanl.gov>
  15. Errors-To: owner-urn-ietf@bunyip.com
  16.  
  17. Hi,
  18.  
  19. I've made an editing pass through the HTTP conventions draft. The
  20. new version (01) is appended. Also, you can fetch it from
  21. http://www.acl.lanl.gov/URN/http_res.txt
  22.  
  23. Regards,
  24. Ron
  25.  
  26. =================================
  27.  
  28. INTERNET DRAFT                                                  Ron Daniel
  29. draft-ietf-urn-http-conv-01.txt             Los Alamos National Laboratory
  30.                                                                9 Jan, 1997
  31.  
  32.  
  33.              Conventions for the Use of HTTP for URN Resolution
  34.  
  35.  
  36. Status of this Memo
  37. ===================
  38.  
  39.     This document is an Internet-Draft.  Internet-Drafts are working
  40.     documents of the Internet Engineering Task Force (IETF), its
  41.     areas, and its working groups.  Note that other groups may also
  42.     distribute working documents as Internet-Drafts.
  43.   
  44.     Internet-Drafts are draft documents valid for a maximum of six
  45.     months and may be updated, replaced, or obsoleted by other
  46.     documents at any time.  It is inappropriate to use Internet-
  47.     Drafts as reference material or to cite them other than as
  48.     ``work in progress.''
  49.   
  50.     To learn the current status of any Internet-Draft, please check
  51.     the ``1id-abstracts.txt'' listing contained in the Internet-
  52.     Drafts Shadow Directories on ftp.is.co.za (Africa),
  53.     nic.nordu.net (Europe), munnari.oz.au (Pacific Rim),
  54.     ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast).
  55.  
  56.     This draft expires 21 July, 1997.
  57.   
  58.   
  59.  
  60. Abstract:
  61. =========
  62.  
  63. The URN-WG was formed to specify persistent, location-independent names
  64. for network accessible resources, as well as resolution mechanisms to retrive
  65. the resources given such a name. At this time the URN-WG is considering
  66. one particular resolution mechanism, the NAPTR proposal [1]. That proposal
  67. specifies how a client may find a "resolver" for a URN, when the URN
  68. does not contain a domain name for that resolver. A resolver is a database
  69. that can tell the client where the resource is, can provide information (such
  70. as a bibliographic citation) on the resource, or may even be able to provide
  71. the resource itself to the client. While the NAPTR draft specifies how to
  72. locate a resolver, it does not specify how the client should speak to the
  73. resolver. Instead, the NAPTR draft provides a field that can be used to
  74. specify the "resolution protocol" the client may use to speak to the
  75. resolver.
  76.  
  77. This draft establishes conventions for using HTTP as one such resolution
  78. protocol. It specifies how to encode URN resolution requests and responses
  79. in HTTP 1.0 (and 1.1) requests and responses. Once a client has used
  80. NAPTR records to locate a resolver that speaks the "http" resolution
  81. protocol, these are the conventions it must follow. The primary goal of
  82. this draft is to define a convention that is simple to implement
  83. and will allow existing HTTP servers to easily add support for URN
  84. resolution. We expect that the resolution databases that arise will be
  85. useful when more sophisticated resolution protocols are developed later.
  86.  
  87.  
  88. 1.0  Introduction:
  89. ==================
  90.  
  91. The NAPTR draft[1] describes a way of using DNS to locate resolvers for
  92. URIs.  That draft provides the services field to specify the "resolution
  93. protocol" spoken by the resolver, as well as the "resolution services"
  94. it offers. As of this writing, the "resolution protocols" allowed by the
  95. NAPTR draft are HTTP, RCDS, HDL, and RWHOIS. (That list is expected to grow
  96. over time). The NAPTR draft also lists a variety of resolution services,
  97. such as N2L (given a URN, return a URL); N2R (Given a URN, return the
  98. named resource), etc. This draft specifies the conventions to follow to
  99. encode resolution service requests in the HTTP protocol, allowing
  100. widely available HTTP daemons to serve as URN resolvers. This is the
  101. specification to follow when the services field ina NAPTR record
  102. begins with "http".
  103.  
  104. The reader is assumed to be familiar with the HTTP/1.0 [2] and 1.1 [3]
  105. specifications. Implementors of this specification should be familiar with
  106. CGI scripts for database lookups.
  107.  
  108.  
  109. 2.0 General Approach:
  110. =====================
  111.  
  112. The general approach used to encode resolution service requests in HTTP
  113. is quite simple: 
  114.  
  115.     GET /uri-res/<service>/<uri>  HTTP/1.0
  116.  
  117. For example, if we have the URN "urn:cid:foo@huh.com" and want a URL,
  118. we would send the request:
  119.  
  120.     GET /uri-res/N2L/urn:cid:foo@huh.com HTTP/1.0
  121.  
  122. Because of the character set limitations on URIs, we might wish to
  123. encode the '@' character as its hex equivalent, thus the request would be
  124.  
  125.     GET /uri-res/N2L/urn:cid:foo%40huh.com HTTP/1.0
  126.  
  127. The request could also be encoded as an HTTP 1.1 request. This would look
  128. like:
  129.  
  130.     GET /uri-res/N2L/urn:cid:foo%40huh.com HTTP/1.1
  131.     Host: <whatever host we are sending the request to>
  132.  
  133. Handling these requests on the server side is easy to implement in a
  134. number of ways. The N2L request could be handled by a CGI script that
  135. took the incoming URN, looked it up in a database, and returned the URL
  136. as an HTTP redirect. Service requests like N2R or N2C could be set up
  137. so that the daemon answered the request by returning files out of N2R/
  138. and N2C/ directories, or they could also be handled by a script that
  139. accessed a database of information.
  140.  
  141. One caveat should be kept in mind. The URN syntax draft[4] discusses
  142. the notion of lexical equivalance. This means that two URIs are equivalent
  143. under certain conditions of case-insensitivity and/or %encoding of characters.
  144. Resolvers MUST return identical results for all lexically equivalent encodings
  145. of a URI. For example, the requests below must return identical results:
  146.     GET /uri-res/N2L/urn:cid:foo@huh.com HTTP/1.0
  147.     GET /uri-res/N2L/URN:CID:foo@huh.com HTTP/1.0
  148.     GET /uri-res/N2L/urn:cid:foo%40huh%2ecom HTTP/1.0
  149.  
  150. Responses from the HTTP server follow standard HTTP practice. Status
  151. codes, such as 200 (OK) or 404 (Not Found) shall be returned.
  152. The normal rules for determining cachability, negotiating formats, etc.
  153. apply.
  154.  
  155.  
  156. 3.0 Service-specific details:
  157. =============================
  158.  
  159. This section goes through the various resolution services established
  160. in the URN services draft[5] and states how to encode each of them,
  161. how the results should be returned, and any special status codes that
  162. are likely to arise.
  163.  
  164. Unless stated otherwise, the HTTP requests are formed according to
  165. the simple convention above, either for HTTP/1.0 or HTTP/1.1. The response
  166. is assumed to be an entity with normal headers and body unless stated
  167. otherwise. (N2L is the only request that need not return a body).
  168.  
  169.  
  170. 3.1  N2L (URN to URL):
  171. ----------------------
  172.  
  173. The request is encoded as above. The URL MUST be returned in a Location:
  174. header for the convienience of the user in the most common case of wanting
  175. the resource. If the lookup is successful, a 30X status line SHOULD be
  176. returned. HTTP/1.1 clients should be sent the 303 status code. HTTP/1.0
  177. clients should be sent the 302 (Moved temporarily) status code unless the
  178. resolver has particular resons for using 301 (moved permanently) or 304
  179. (not modified) codes.
  180.  
  181. Note that access controls may be applied to this, or any other, resolution
  182. service request. Therefore the 401 (unauthorized) and 403 (forbidden)
  183. status codes are legal responses. The server may wish to provide a body
  184. in the response to explain the reason for refusing access, and/or to provide
  185. alternate information about the resource, such as the price it will cost
  186. to obtain the resource's URL.
  187.  
  188. 3.2  N2Ls (URN to URLs):
  189. ------------------------
  190.  
  191. The request is encoded as above. The result is a list of 0 or
  192. more URLs. The Internet Media Type (aka ContentType) of the result
  193. may be negotiated using standard HTTP mechanisms if desired. At a
  194. minimum the resolver should support the text/uri-list media type.
  195. (See Appendix A for the definition of this media type). That media
  196. type is suitable for machine-processing of the list of URLs. Resolvers
  197. may also return the results as text/html, text/plain, or any other
  198. media type they deem suitable.
  199.  
  200. No matter what the particular media type, the result MUST be a list
  201. of the URLs which may be used to obtain an instance of the resource
  202. identified by the URN. All URIs shall be encoded according to the
  203. URI specification [6].
  204.  
  205. If the client has requested the result be returned as text/html or
  206. application/html, the result should be encoded as:
  207. <UL>
  208. <LI><A HREF="...url 1...">...url 1...</A>
  209. <LI><A HREF="...url 2...">...url 2...</A>
  210.  etc.
  211. </UL>
  212. where the strings ...url n... are replaced by the n'th URL in the list.
  213.  
  214.  
  215. 3.3  N2R (URN to Resource):
  216. ---------------------------
  217.  
  218. The request is encoded as above. The resource is returned using
  219. standard HTTP mechanisms. The request may be modified using the
  220. Accept: header as in normal HTTP to specify that the result
  221. be given in a preferred Internet Media Type.
  222.  
  223.  
  224. 3.4  N2Rs (URN to Resources):
  225. -----------------------------
  226.  
  227. This resolution service returns multiple instances of a resource,
  228. for example, GIF and JPEG versions of an image. The judgment about
  229. the resources being "the same" resides with the naming authority that
  230. issued the URN.
  231.  
  232. The request is encoded as above. The result shall be a MIME
  233. multipart/alternative message with the alternative versions of the
  234. resource in seperate body parts. If there is only one version of
  235. the resource identified by the URN, it MAY be returned without the
  236. multipart/alternative wrapper. Resolver software SHOULD look at the
  237. Accept: header, if any, and only return versions of the resource
  238. that are acceptable according to that header. 
  239.  
  240.  
  241. 3.5  N2C (URN to URC):
  242. ----------------------
  243.  
  244. URCs (Uniform Resource Characteristics) are descriptions of other
  245. resources. This request allows us to obtain a description of the
  246. resource identified by a URN, as opposed to the resource itself.
  247. The description might be a bibliographic citation, a digital signature,
  248. a revision history, etc. This draft does not specify the content of
  249. any response to a URC request. That content is expected to vary from
  250. one resolver to another.
  251.  
  252. The format of any response to a N2C request MUST be communicated using the
  253. ContentType header, as is standard HTTP practice. The Accept: header
  254. SHOULD be honored.
  255.  
  256.  
  257. 3.6  N2Ns (URN to URNs):
  258. ------------------------
  259.  
  260. While URNs are supposed to identify one and only one resource, that
  261. does not mean that a resource may have one and only one URN. For
  262. example, consider a resource that has something like
  263. "current-weather-map" for one URN and "weather-map-for-datetime-x" for
  264. another URN. The N2Ns service request lets us obtain lists of URNs that
  265. are believed equivalent at the time of the request. As the weathermap
  266. example shows, some of the equivalances will be transitory, so the
  267. standard HTTP mechanisms for communicating cachability MUST be honored.
  268.  
  269. The request is encoded as above. The result is a list of all the
  270. URNs, known to the resolver, which identify the same resource as the
  271. input URN. The result shall be encoded as for the N2Ls request
  272. above (text/uri-list unless specified otherwise by an Accept: header).
  273.  
  274. 3.7  L2Ns (URL to URNs):
  275. ----------------------
  276.  
  277. The request is encoded as above. The response is a list of any URNs
  278. known to be assigned to the resource at the given URL. The result
  279. shall be encoded as for the N2Ls and N2Ns requests.
  280.  
  281.  
  282. 3.8  L2Ls (URL to URLs):
  283. ------------------------
  284.  
  285. The request is encoded as described above. The result is a list of
  286. all the URLs that the resolver knows are associated with the resource
  287. located by the given URL. This is encoded as for the N2Ls, N2Ns, and L2Ns
  288. requests.
  289.  
  290.  
  291. 3.9  L2C (URL to URC):
  292. ----------------------
  293.  
  294. The request is encoded as above, the response is the same as for the
  295. N2C request.
  296.  
  297.  
  298. Appendix A: The text/uri-list Internet Media Type
  299. =================================================
  300. [This appendix will be augmented or replaced by the registration
  301. of the text/uri-list IMT once that registration has been performed].
  302.  
  303. Several of the resolution service requests, such as N2Ls, N2Ns, L2Ns,
  304. L2Ls, result in a list of URIs being returned to the client. The
  305. text/uri-list Internet Media Type is defined to provide a simple format
  306. for the automatic processing of such lists of URIs.
  307.  
  308. The format of text/uri-list resources is:
  309. 1) Any lines beginning with the '#' character are comment lines
  310.    and are ignored during processing. (Note that '#' is a character
  311.    that may appear in URIs, so it only denotes a comment when it is the
  312.    first character on a line).
  313. 2) The remaining non-comment lines MUST be URIs (URNs or URLs), encoded
  314.    according to the URI specification RFC[6]. Each URI shall appear on
  315.    one and only one line.
  316. 3) As for all text/* formats, lines are terminated with a CR LF pair.
  317.  
  318. In applications where one URI has been mapped to a list of URIs, such
  319. as in response to the N2Ls request, the first line of the text/uri-list
  320. response SHOULD be a comment giving the original URI. 
  321.  
  322. An example of such a result for the N2L request is shown below in figure 1.
  323.  
  324.      # urn:cid:foo@huh.org
  325.      http://www.huh.org/cid/foo.html
  326.      http://www.huh.org/cid/foo.pdf
  327.      ftp://ftp.foo.org/cid/foo.txt
  328.  
  329.                Figure 1: Example of the text/uri-list format
  330.  
  331.  
  332. Appendix B:  n2l.pl script
  333. ==========================
  334.  
  335. This is a simple CGI script for the N2L resolution service. It
  336. assumes the presence of a DBM database to store the URN to URL
  337. mappings. This script does not specify standard behavior, it is
  338. provided merely as a courtesy for implementors. In fact, this
  339. script does not process incoming Accept: headers, nor does it
  340. generate status codes. Such behavior should be part of a real
  341. script for any of the resolution services.
  342.  
  343.  
  344.     #!/bin/perl
  345.     # N2L  - performs urn to url  resolution 
  346.  
  347.     $n2l_File = "...filename for DBM database...";
  348.  
  349.  
  350.     $urn = $ENV{'PATH_INFO'} ;
  351.     if(length($urn)<3)
  352.     {
  353.         $error=1;
  354.     }
  355.  
  356.     if(!$error)
  357.     {
  358.         $urn =~s/^(\/)(urn:)?(.*)/$3/i;
  359.         # Additional operations should be performed here
  360.         # to convert lexically equivalent versions of a URI into
  361.         # a canonical version for DB lookups.
  362.  
  363.         dbmopen(%lu,$n2l_File,0444);
  364.         if($lu{$urn})
  365.         {
  366.         $url=$lu{$urn};
  367.         print STDOUT "Location: $url\n\n";
  368.         }else{
  369.         $error=2;
  370.         }
  371.         dbmclose(%lu);
  372.     }
  373.  
  374.     if($error)
  375.     {
  376.         print "Content-Type: text/html \n\n";
  377.         print "<html>\n";
  378.         print "<head><title>URN Resolution: N2L</title></head>\n";
  379.         print "<BODY>\n";
  380.         print "<h1>URN to URL resolution failed for the URN:</h1>\n";
  381.         print "<hr><h3>$urn</h3>\n";
  382.         print "</body>\n";
  383.         print "</html>\n";
  384.     }
  385.  
  386.     exit;
  387.  
  388.  
  389. References:
  390. ===========
  391.  
  392. [1] Ron Daniel and Michael Mealling, "Resolution of Uniform Resource
  393.     Identifiers using the Domain Name System", draft-ietf-urn-naptr-01.txt,
  394.     November, 1996.
  395.  
  396. [2] RFC 1945, "Hypertext Transfer Protocol -- HTTP/1.0", T. Berners-Lee,
  397.     R. Fielding, H. Frystyk, May 1996.
  398.  
  399. [3] R. Fielding, J. Gettys, J.C. Mogul, H. Frystyk, T. Berners-Lee,
  400.     "Hypertext Transfer Protocol -- HTTP/1.1", draft-ietf-http-v11-spec-06,
  401.     July 1996.
  402.  
  403. [4] R. Moats, "URN Syntax", draft-ietf-urn-syntax-02, Jan. 1997.
  404.  
  405. [5] URN Resolution Services Draft -  (That document is in preparation.
  406.     It will actually be strongly based on the content of this document and
  407.     the NAPTR draft[1]). 
  408.  
  409. [6] RFC 1630, "Universal Resource Identifiers in WWW: A Unifying Syntax for
  410.     the Expression of Names and Addresses of Objects on the Network as
  411.     used in the World-Wide Web", T. Berners-Lee, June 1994.
  412.  
  413.  
  414. Security Considerations
  415. =======================
  416.   Communications with a resolver may be of a sensitive nature. Some
  417.   resolvers will hold information that should only be released to
  418.   authorized users. The results from resolvers may be the target of
  419.   spoofing, especially once electronic commerce transactions are common
  420.   and there is money to be made by directing users to pirate repositories
  421.   rather than repositories which pay royalties to rightsholders. Resolution
  422.   requests may be of interest to traffic analysts. The requests may also
  423.   be subject to spoofing.
  424.  
  425.   The requests and responses in this draft are amenable to encoding,
  426.   signing, and authentication in the manner of any other HTTP traffic.
  427.  
  428.  
  429. Author Contact Information:
  430. ===========================
  431.  
  432. Ron Daniel
  433. Advanced Computing Lab, MS B287
  434. Los Alamos National Laboratory
  435. Los Alamos, NM, USA, 87545
  436. voice:  +1 505 665 0597
  437. fax:    +1 505 665 4939
  438. email:  rdaniel@lanl.gov
  439.  
  440.  
  441.     This draft expires 21 July, 1997.
  442.  
  443. Ron Daniel Jr.                   email: rdaniel@acl.lanl.gov
  444. Advanced Computing Lab, MS B287  voice: (505) 665-0597
  445. Los Alamos National Laboratory     fax: (505) 665-4939
  446. Los Alamos, NM, USA 87545         http://www.acl.lanl.gov/~rdaniel/
  447. Want to buy: "The Five Laws of Library Science" by S.R. Ranganathan